<template>
  <el-table :data="tableData" border style="width: 100%">
    <el-table-column prop="username" label="用户名" />
    <el-table-column prop="user_ip" label="登录ip" />
    <el-table-column prop="isSuccess" label="操作"> </el-table-column>
    <el-table-column prop="login_time" label="登录时间" />
  </el-table>
  <Pagination :count="count" @page-change="pageChange"></Pagination>
</template>
<script lang="ts" setup>
import Pagination from "@/components/Pagination.vue";
import { logInfo } from "../request/api";
import { ref, reactive } from "vue";
const tableData = ref([]);
const count = ref(0);
const page = reactive({
  pageSize: 12,
  page: 1,
});
async function getLog() {
  const { data } = await logInfo(page);
  console.log(data, 11111);
  count.value = data.count;
  tableData.value = data.res;
}
const pageChange = (e: number) => {
  page.page = e;
  getLog();
};
getLog();
</script>
